// API响应基础接口
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data: T;
}

// 分页请求参数
export interface PaginationParams {
  pageIndex: number;
  pageSize: number;
}

// 分页响应数据
export interface PaginationResult<T> {
  total: number;
  pageIndex: number;
  pageSize: number;
  items: T[];
}

// 用户相关接口
export interface LoginParams {
  username: string;
  password: string;
  captchaId: string;
  captchaCode: string;
}

export interface LoginResult {
  token: string;
}

export interface CaptchaResult {
  captchaId: string;
  imageUrl: string;
}

export interface UserInfo {
  id: number;
  username: string;
  email?: string;
  realName?: string;
  phoneNumber?: string;
  role: string;
  lastLoginTime?: string;
}

// 修改密码参数
export interface ChangePasswordParams {
  oldPassword: string;
  newPassword: string;
}

// 溯源管理相关接口
export interface TraceabilityItem {
  id: number;
  traceabilityCode: string;
  productName: string;
  productionBatch: string;
  productionDate: string;
  expirationDate: string;
  licenseNumber: string;
  productionCompany: string;
  completenessScore: number;
  coverImage?: string;
  createdTime: string;
  updatedTime: string;
}

export interface TraceabilityQueryParams extends PaginationParams {
  productName?: string;
  productionBatch?: string;
  expirationStart?: string;
  expirationEnd?: string;
  licenseNumber?: string;
  productionCompany?: string;
}

export interface TraceabilityCreateParams {
  productName: string;
  productionBatch: string;
  productionDate: string;
  expirationDate: string;
  licenseNumber: string;
  productionCompany: string;
  coverImage?: string;
}

export interface TraceabilityUpdateParams extends TraceabilityCreateParams {
  id: number;
}

// 文件上传相关接口
export interface UploadResult {
  url: string;
  fileName: string;
} 